package com.yc.bbs.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yc.bbs.entity.TblReply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.bbs.entity.TblTopic;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * BBS论坛-回帖表-2 Mapper 接口
 * </p>
 *
 * @author k
 * @since 2024-11-25
 */
public interface TblReplyMapper extends BaseMapper<TblReply> {
    @Select("SELECT\n" +
            "	a.*,\n" +
            "	b.cname \"user.cname\"," +
            "	b.head \"user.head\"," +
            "	b.regtime \"user.regtime\"" +
            "FROM\n" +
            "	tbl_reply a\n" +
            "	JOIN tbl_user b ON a.uid = b.id\n" +
            "where topicid = #{tid}")
    Page<TblReply> selectByTid(@Param("tid") int tid, Page<TblReply> page);
}
